const express = require('express')
const cors = require('cors')
const Mock = require('mockjs')
const uuid = require('uuid/v1')

const app = express();
app.use(cors())
app.use(express.static('./public'));
//首页
//小图导航
app.get('/nav', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|15': [
            {
                id: '@uuid',//内部就有的，用的就是第三方的
                'idcnUrl|+1': [
                    '/upload/nav1.webp',
                    '/upload/nav2.webp',
                    '/upload/nav3.webp',
                    '/upload/nav4.webp',
                    '/upload/nav5.webp',
                    '/upload/nav6.webp',
                    '/upload/nav7.webp',
                    '/upload/nav8.webp',
                    '/upload/nav9.webp',
                    '/upload/nav10.webp',
                    '/upload/nav11.webp',
                    '/upload/nav12.webp',
                    '/upload/nav13.webp',
                    '/upload/nav14.webp',
                    '/upload/nav15.webp',
                ],//图标
                'text|+1': [
                    '女装',
                    '上衣',
                    '裙子',
                    '裤子',
                    '套装',
                    '女鞋',
                    '美妆/个护',
                    '包包',
                    '配饰',
                    '内衣',
                    '男友',
                    '家居',
                    '母婴',
                    '食品',
                    '签到',
                ],//文字

                //商城导航
                'rImgs|+1': [
                    '/upload/st8.webp',
                    '/upload/st12.webp',
                    '/upload/st1.webp',
                    '/upload/st7.webp',
                    '/upload/st6.webp',
                    '/upload/st13.webp',
                    '/upload/st14.webp',
                    '/upload/st9.webp',
                    '/upload/st11.webp',
                    '/upload/st10.webp',
                    '/upload/st4.webp',
                    '/upload/st5.webp',
                    '/upload/st2.webp',
                    '/upload/st3.webp',
                    '/upload/st15.webp',
                ],
                'text1|+1': [
                    '女装',
                    '上衣',
                    '裙子',
                    '裤子',
                    '套装',
                    '女鞋',
                    '运动',
                    '美妆/个护',
                    '包包',
                    '配饰',
                    '内衣',
                    '男友',
                    '家居',
                    '母婴',
                    '食品',
                ],//商城文字
            }
        ],
    }))
})
//轮播图
app.get('/play', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|3': [{
            id: '@uuid',
            'plays|+1': [
                '/upload/ilb1.webp',
                '/upload/ilb2.webp',
                '/upload/ilb3.webp'
            ],
            //商城滑动图
            'stbox|+1': [{
                img1: '/upload/stbo1.jpg',
                img2: '/upload/stbo2.jpg',
                img3: '/upload/stbo3.jpg',
            },
            {
                img1: '/upload/stbo4.png',
                img2: '/upload/stbo5.jpg',
                img3: '/upload/stbo6.png',
            }
            ],
            'title|+1': [{
                tet1: '又暖又软@羊羔毛',
                tet2: '雪地靴穿搭经',
                tet3: '网红穿搭种草',
            },
            {
                tet1: '品质好货甄选',
                tet2: '超火内搭来袭',
                tet3: "",
            }],
            'text|+1': [{
                tex1: '冬日扛坝子时髦UP',
                tex2: '让你轻松告别石膏脚',
                tex3: '跟着穿吸睛max',
            }, {
                tex1: '好看好用不贵',
                tex2: '内搭',
                tex2: "外穿内搭人手一件",
            }
            ]
        }]
    }))
})

//内容数据
app.get('/listnr', (req, res) => {
    res.send(Mock.mock({
        error: null,
        //http://127.0.0.1:4007/upload/tx.jpg
        'data|5': [{
            id: '@uuid',
            'tx|+1': [
                '/upload/tx.jpg',
                '/upload/tx1.jpg',
                '/upload/tx2.jpg',
                '/upload/tx4.jpg',
                '/upload/tx5.jpg'
            ],
            'title|+1': [
                'is圆脸妹ya',
                '冲浪网民小号',
                '会飞的小毯',
                '壹条猫',
                'InsSakl',
                '崔小棍Tsui'
            ],
            'text|+1': [
                '164cm 44KG | 杭州 |学生',
                '164cm 46KG | 西安|大一学生',
                '☘踏青季节到啦|带着我的❤“小心机”出门了',
                '164cm 46KG | 西安|大一学生',
                '164cm 45KG | 成都|学生',
                '中国| 更新31个LOOK',
                '155cm 40KG | 南京|学生',
            ],
            'imgs|+1': [
                {
                    img0: '/upload/icon1.webp',
                    img1: '/upload/icon2.webp',
                    img2: '/upload/icon3.webp',
                },
                {
                    img0: '/upload/icon4.webp',
                    img1: '/upload/icon5.webp',
                    img2: '/upload/icon6.webp',
                },
                {
                    img0: '/upload/icon7.webp',
                    img1: '/upload/icon8.webp',
                    img2: '/upload/icon9.webp',
                },
                {
                    img0: '/upload/icon10.webp',
                    img1: '/upload/icon12.webp',
                    img2: '/upload/icon13.webp',
                }
            ],
            'bq|+1': [
                {
                    bqimg: '/upload/ibq1.jpg',
                    txt: 'LUVON',
                },
                {
                    bqimg: '/upload/ibq2.jpg',
                    txt: '李婉君'
                },
                {
                    bqimg: '/upload/ibq3.jpg',
                    txt: '丁走走的店'
                },
                {
                    bqimg: '/upload/ibq4.webp',
                    txt: 'UNIQLO'
                }

            ]
        }
        ]
    }))
})


//商城
app.get('/stnav', (req, res) => {
    res.send(Mock.mock({
        'data|4': [{
            id: '@uuid',
            'img|+1': [
                '/upload/snav1.jpg',
                '/upload/snav2.jpg',
                '/upload/snav3.jpg',
                '/upload/snav4.jpg',
            ],
            'txt|+1': [
                '风尚快抢',
                '热销榜单',
                '好货精选',
                '新品快抢'
            ]
        }]
    }))
})
//流行元素
app.get('/fash', (req, res) => {
    res.send(Mock.mock({
        'data|9': [{
            'text|+1': [
                '省心两件套',
                '潮男休闲裤',
                '萌宝套装',
                '仙女系雪纺',
                '裙子套装',
                '高颜值内搭',
                '睡衣套装',
                '不羁牛仔',
                '时髦套装',
                '懒人三件套'
            ],
            'img|+1': [
                '/upload/stn1.png',
                '/upload/stn2.png',
                '/upload/stn3.png',
                '/upload/stn4.png',
                '/upload/stn5.png',
                '/upload/stn6.png',
                '/upload/stn7.png',
                '/upload/stn8.png',
                '/upload/stn9.png',
                '/upload/stn10.png',
            ]
        }]
    }))
})
//商城商品
app.get('/like', (req, res) => {
    res.send(Mock.mock({
        'data|4': [{
            id: '@uuid',
            'img|+1': [
                '/upload/slo1.webp',
                '/upload/slo2.webp',
                '/upload/slo3.webp',
                '/upload/slo4.webp',

            ],
            'title|+1': [
                '小个子春装女套装新款薄ins卫衣女春秋百搭套头上衣+休闲运动裤女高腰显瘦针织卫裤套装两件套',
                '春夏新款韩版后百褶白色衬衫连衣裙宽松五分袖短裙子',
                '港味初春套装女夏季时尚宽松长袖外套高腰束脚哈伦裤休闲裤两件套',
                '红色法式衬衫连衣裙韩版时尚女装气质中长款过膝宽松高腰打底裙女'
            ],
            'pj|+1': [{
                xx: '/upload/xx.png',
                'price|50-1000': 0
            }],
            'price|30-100': 0,
            'txt': '立即购买'
        }]
    }))
})
//商品列表
app.get('/goods', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|8': [{
            id: '@uuid',
            'img|+1': [
                '/upload/li1.webp',
                '/upload/li2.webp',
                '/upload/li3.webp',
                '/upload/li4.webp',
                '/upload/li5.webp',
                '/upload/li6.webp',
                '/upload/li7.webp',
                '/upload/li8.webp'
            ],
            'tit|+1': ['热卖', '热卖', '', '', '', '', '', '', ''],
            'text|+1': ['港味复古ins秋季新款韩国chic学院风BF九分女学生卷边宽松原宿风个性哈伦阔腿直筒牛仔裤',
                'ins港风短袖t恤女装新款韩版宽松原宿bf丧系上衣服潮cec',
                '春季19新款时尚休闲运动卫衣套装女嘻哈束脚裤子学生韩版两件套',
                '秋冬百搭时尚好看半高领短袖t恤女宽松酷酷的女装帅气欧货重工打底衫女'
            ],
            'price|29-200': 0,
            dz: '/upload/xx.png',
            'number|50-1000': 0,

        }]
    }))
})

//菜单
app.get('/menus', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|27': [{
            id: '@uuid',
            'img|+1': [
                '/upload/me1.webp',
                '/upload/me2.webp',
                '/upload/me3.webp',
                '/upload/me4.webp',
                '/upload/me5.webp',
                '/upload/me6.webp',
                '/upload/me7.webp',
                '/upload/me8.webp',
                '/upload/me9.webp',
                '/upload/me10.webp',
            ],
            'txt|+1': [
                '春上新',
                '早春外套',
                '必备内搭',
                '气质毛呢',
                '毛衣',
                '卫衣',
                '打底衫',
                '帆布鞋',
                '活力运动',
                '小个子短款',
                '针织衫',
                '衬衫',
                '连帽卫衣',
                '百搭T恤',
                '风衣',
                '毛衣开衫',
                '棒球外套',
                '牛仔外套',
                '西装外套',
                '皮夹克',
                '经典条纹',
                '白衬衫',
                '显瘦露肩',
                '雪纺衫',
                'BF风衬衫',
                '甜美蕾丝',
                '背心吊带',
            ],
            //菜单中间部分商品
            'com|+1': [
                '/upload/mq1.webp',
                '/upload/mq2.webp',
                '/upload/mq3.webp',
                '/upload/mq4.webp'
            ],
            'num|200-1000': 0,
            'text|+1': [
                '2019夏季新款文艺复古重工蕾丝拼接花朵刺绣气质连衣裙立领改良旗袍修身长裙',
                '2019新款韩版仙女渐变色纱裙子女亮闪闪星星网纱半身裙洋气撞色拼色中长款a字裙高腰蓬蓬裙',
                '2019新款仙女吊带多层蛋糕连衣裙内搭背心打底裙子',
                '满天星3M反光侃爷情侣椰子运动鞋网红泡泡真爆女鞋厚底小白鞋潮'],
            'price|70-300': 0,
            'num1|600-1000': 0,
            'pj': '/upload/xx.png'
        }]
    }))
})

//关注
app.get('/focus', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|2': [{
            id: '@uuid',
            'tx|+1': ['/upload/fo1.webp', '/upload/fo1.webp',],
            'title|+1': ['刘军LJFashion'],
            'rz|+1': ['/upload/fo2.png'],
            'span|+1': ['158cm 40kg| 深圳 | 新媒体'],
            'number|10-30': 0,
            'bd|+1': ['第14周达人榜'],
            'img|+1': [{
                img1: '/upload/fo3.webp',
                img2: '/upload/fo4.webp',
                img3: '/upload/fo5.webp',
                img4: '/upload/fo6.webp',
            },
            {
                img1: '/upload/fo7.webp',
                img2: '/upload/fo8.webp',
                img3: '/upload/fo9.webp',
                img4: '/upload/fo10.webp',
            }],
            'tb|+1': [{
                tb1: '/upload/fx.png',
                tb2: '/upload/fwx.png',
                tb3: '/upload/fxx.png',
                tb4: '/upload/fzai.png'
            }],
            'num|90-300': 0,
            'bt|+1': ['#忽冷忽热，薄外套记得备好哦！#'],
            'text|+1': ['一早一晚还是外套来的保暖,这个天说热就热了,但是一早一晚还是很冷,所以薄外套还是很需要的,这件外套颜色我非常喜欢,淡绿色的，非常显肤色,建议黄皮女生可以试一试,很薄所以即使这个天，中午穿也不是很热'],
            'num1|1-7': 0,
            'num2|2000-8000': 0
        }]
    }))
})

//商品详情表
app.get('/commod', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|4': [{
            id: '@uuid',
            'img|+1': [
                '/upload/co1.webp',
                '/upload/co2.webp',
                '/upload/co3.webp',
                '/upload/co4.webp',
            ]
        }]
    }))
})
//图文详情
app.get('/det', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|7': [{
            id: '@uuid',
            'img|+1': [
                '/upload/pre1.webp',
                '/upload/pre2.webp',
                '/upload/pre3.webp',
                '/upload/pre4.webp',
                '/upload/pre5.webp',
                '/upload/pre6.webp',
                '/upload/pre7.webp',
            ],
        }]
    }))
})
//商品参数
app.get('/param', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|4': [{
            id: '@uuid',
            'size|+1': ['M', 'L', 'XL', 'XXL'],
            'width|+1': [49, 51, 53, 55],
            'height|+1': [66, 68, 70, 72],
            'wei|+1': [104, 108, 112, 116],
            'xiu|+1': [19, 20, 21, 22]

        }]
    }))
})
//商品参数列表
app.get('/pritem', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|13': [{
            id: '@uuid',
            'text|+1': ['图案', '颜色', '袖型', '尺码', '衣长', '版型', '季节', '材质', '领型', '元素', '袖长', '风格', '潮流'],
            'val|+1': ['字母/文字/数字', '黑色，白色，灰色', '常规袖', 'XL,L,M,XXL',
                '中长款（60—80cm）', '宽松', '夏季', '棉', '圆领', '柔软洗', '短袖', '简约', '英伦',]
        }]
    }))
})
//最后底部图片
app.get('/comfoot', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|12': [{
            id: '@uuid',
            'img|+1': [
                '/upload/fco1.webp',
                '/upload/fco2.webp',
                '/upload/fco3.webp',
                '/upload/fco4.webp',
            ],
            'p|+1': ['夏季韩版ins原宿港风女口袋字母印花情侣bf宽松短袖T恤上衣',
                '洋气网红宽松字母短袖t恤女学生韩版ulzzang半袖百搭上衣',
                '夏季韩版原宿港风bf宽松百搭打底短袖T恤女ins网红同款后背字母上衣学生潮',
                '短袖T恤女2019夏季新款韩版宽松圆领套头印花学生原宿bf风百搭简约洋气闺蜜装上衣潮'],
            'price|20-40': 0
        }]
    }))
})
//商品详情页数据
app.get('/product', (req, res) => {
    res.send(Mock.mock({
        error: null,
        data: {
            id: '@uuid',
            'store': {
                '白色': {
                    's|1-10': 0,
                    'm|1-20': 0,
                    'l|1-10': 0,
                    'xl|1-10': 0,
                },
                '黑色': {
                    'm|1-10': 0,
                    'l|1-20': 0,
                    'xl|1-10': 0,
                    'xxl|1-10': 0,
                },
                '灰色': {
                    's|1-10': 0,
                    'l|1-10': 0,
                    'xl|1-10': 0,
                    'xxl|1-10': 0,
                }
            }
        }
    }))
})
//店铺详情页
app.get('/store', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|6': [{
            id: '@uuid',
            'img|+1': [
                '/upload/simg1.webp',
                '/upload/simg2.webp',
                '/upload/simg3.webp',
                '/upload/simg4.webp',
                '/upload/simg5.webp',
                '/upload/simg6.webp',
            ],
            'text|+1': [
                '牛油果上衣短袖T恤女显瘦+高腰百褶格子裙',
                '初春新款女装韩版套装小清新休闲短款纯色毛针织开衫外套显瘦吊带拼接网纱裙女时尚两件套'],
            'price|30-100': 0,
            'num|100-500': 0,
            'star': ['/upload/xx.png']
        }]
    }))
})
//新品推荐
app.get('/stnew', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|6': [{
            id: '@uuid',
            'img|+1': [
                '/upload/new1.webp',
                '/upload/new2.webp',
                '/upload/new3.webp',
                '/upload/new4.webp',
                '/upload/new5.webp',
                '/upload/new6.webp',
            ],
            'text|+1': [
                '初恋款仙女夏过膝泡泡袖很仙的法国小众连衣',
                '时尚套装纯色露腰短袖休闲黑色宽松显瘦开叉垂感直筒西装阔腿裤'],
            'price|30-100': 0,
            'num|0-5': 0,
            'star': ['/upload/xx.png']
        }]
    }))
})
//购物车
app.get('/shop', (req, res) => {
    res.send(Mock.mock({
        error: null,
        'data|2': [{
            id: '@uuid',
            'title|+1': ['屈原游泳馆', 'LOVROM'],
            'img|+1': [
                '/upload/shop1.webp',
                '/upload/shop2.webp',
            ],
            'text|+1': [
                'ins港风短袖t恤女装新款韩版宽松原宿bf丧系上衣服潮cec',
                '2019春季哈伦牛仔裤女宽松韩版学生直筒阔腿高腰休闲裤九分裤女',
            ],
            'desc|+1': ['颜色：白色；尺码：XL；', '颜色：复古蓝；尺码：L；'],
            'color|+1': ['杏色', '复古蓝', '灰色'],
            'size|+1': ['均码', 'L', 'XL'],
            'sprice|40-100': 0,
            'price|70-200': 0,
            'num|5-20': 0
        }]

    }))
})
app.listen(4007)